package com.bll.imple.mymienAction;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bean.MymienBean;
import com.bll.Action;
import com.dao.MymienDao;
import com.dao.Page;

public class ShowfMymienAction implements Action{
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
				String lujing=request.getParameter("lujing");  
		int type=Integer.parseInt(request.getParameter("typeId"));
		int state=Integer.parseInt(request.getParameter("state"));
		System.out.println("state:"+state);
		if(type==1){
			System.out.println("type:"+type);
			int userId=Integer.parseInt(request.getSession().getAttribute("userId").toString());
			 MymienDao dao=new MymienDao();
			 List<MymienBean> mymiens=dao.SelNotZ(type, userId);
			 MymienBean bean=dao.SelZhiding(type,userId);
			 System.out.println("-------------------"+bean.getTitleInfo());
			 request.setAttribute("zhiding",bean);
			 request.setAttribute("list", mymiens);
		}else{
			int userId=Integer.parseInt(request.getSession().getAttribute("userId").toString());
			MymienDao dao=new MymienDao();
			List<MymienBean> mymiens=dao.SelectAll(type, userId);
			 request.setAttribute("list", mymiens);
		}
		return lujing;
	}
}
